cd "F:\Dropbox\School\Research Projects\Populism\Articles\Populist Psychology\Submission files\JOP 2020\Final\Replication files"

use "study 2 prepped.dta", clear

gen cultdisc_joint = cultdisc + idmarg
sum cultdisc_joint
replace cultdisc_joint = (cultdisc_joint - r(min))/(r(max)-r(min))



foreach var of varlist ant ppl man anger fear cultdisc idmarg cultdisc_joint econeval ideo imm {
qui sum `var'
replace `var' = (`var' - `r(min)') / (`r(max)'-`r(min)')
}

gen imm_negat = (imm*-1)+1

reg prej_fs c.cultdisc_joint##c.ideo econeval anger fear female ed clase age
margins, dydx(cultdisc_joint) at(ideo=(0 (.05) 1))
marginsplot, recast(line) recastci(rarea)
reg imm_negat c.cultdisc_joint##c.ideo  anger fear female ed clase age
margins, dydx(cultdisc_joint) at(ideo=(0 (.05) 1))
marginsplot, recast(line) recastci(rarea)
